{% load engine_tags %}

<div class="ui divided link items" >

    {% for job in job_list %}

        <div class="item job" data-value="{{ job.uid }}">

            {% job_img job %}

                <div class="{% if colwidth %}{{ colwidth }}{% else %}twelve{% endif %} wide column">
                    <div class="content">
 {# Rerun and delete options for authenticated users #}
                    {% if user.is_authenticated %}
                        <div class="ui mini buttons" style="float: right;">

                            <a class="ui right button" href="{% url "job_rerun" job.uid %}">
                                <i class="redo icon"></i>Rerun
                            </a>

                            <div class="or"></div>

                            <a class="ui right button delete">
                                <i class="trash icon"></i> Delete
                            </a>
                        </div>

                    {% endif %}
                        {# Display the job name #}
                        <a class="subheader link" href="{{ job.url }}">
                            <i class="bar chart icon"></i>{{ job.get_name }}
                        </a>
                        {# Display the job summary #}
                        <div class="ui text container">
                            <div class="meta">{{ job.summary|markdown|safe|truncatechars_html:150 }}</div>
                        </div>
                        {# Show the job state and time elapsed  #}
                        <div class="extra">
                            <span class="state">{% job_minutes job view=False %}</span>&bull;
                            {% created_by date=job.lastedit_date user=job.lastedit_user %}
                        </div>

                    </div>
                </div>


        </div>

    {% empty %}
        <div class="item">
            <div class="ui warning message"><i class="ui info circle icon"></i>This recipe does not have results in the
                current project.
            </div>
        </div>
    {% endfor %}
</div>
